# -*- coding: utf-8 -*-
"""
Created on Tue Apr 14 14:42:38 2020

@author: Administrator
"""

import re
import time
import random
import requests
import json
import pandas as pd
name,specs,market,date,price,website=[ ],[ ],[ ],[ ],[ ],[ ]
A=["11306990004860100","11306990004860200","11306990004860300","11306990004860400","11306990004860500","11306990004860700","13416990004860100","13416990004860200","13416990004860300","13416990004860400","13416990004860500","13416990004860600","13416990004860700","15101990004860100","15101990004860200","15101990004860300","15101990004860400","15101990004860500","15101990004860600","14509990004860200","14509990004860300","14509990004860400","14509990004860500","14509990004860600","14509990004860700","11306990001260100","13416990001260100","15101990001260100","15101990001260200","15101990001260300","14509990001260100","11306990001310200","11306990001310300","13416990001310200","13416990001310300","15101990001310800","15101990001310900","15101990001311000","14509990001310200","14509990001310300","11306990001320100","11306990001320200","13416990001320100","13416990001320200","15101990001320100","15101990001320200","14509990001320100","14509990001320200","11306990001670200","11306990001670300","11306990001670400","13416990001670200","13416990001670300","13416990001670400","13416990001670500","15101990001671700","15101990001671800","14509990001670600","14509990001670700","11306990002450400","11306990002451000","13416990002450400","13416990002451000","15101990002450400","15101990002451000","14509990002450400","14509990002451000","11306990008070100","11306990008070200","13416990008070100","13416990008070200","15101990008070100","15101990008070200","14509990008070100","14509990008070200","11306990002830100","11306990002830200","13416990002830100","13416990002830200","15101990002830600","15101990002830900","15101990002831000","14509990002830100","14509990002830200","11306990003220200","11306990003220300","11306990003220400","11306990003220500","11306990003220600","11306990003220700","11306990003221000","13416990003220200","13416990003220300","13416990003220400","13416990003220500","13416990003220600","13416990003220700","13416990003221000","13416990003221200","13416990003221300","13416990003221400","13416990003222000","15101990003220200","15101990003220300","15101990003221800","14509990003220200","14509990003220600","14509990003221200","11306990000700100","11306990000700200","13416990000700100","13416990000700200","15101990000700200","15101990000700300","14509990000700200","11306990003850100","11306990003850200","13416990003850100","13416990003850200","15101990003850100","15101990003850200","14509990003850100","14509990003850200","11306990003860100","11306990003860200","11306990003860300","13416990003860100","13416990003860200","13416990003860300","15101990003860100","15101990003860200","15101990003860300","14509990003860100","14509990003860200","14509990003860300","11306990004090100","13416990004090100","15101990004090100","14509990004090100","11306990004780100","11306990004780200","11306990004780300","13416990004780100","13416990004780200","15101990004780100","15101990004780200","15101990004780300","14509990004780100","14509990004780200","14509990004780300","11306990000320100","11306990000320300","11306990000320400","13416990000320100","13416990000320300","13416990000320400","13416990000320500","15101990000320900","15101990000321000","15101990000321100","14509990000320900","14509990000321000","11306990002081400","11306990002081500","13416990002080100","13416990002080400","13416990002080800","13416990002081400","13416990002081600","15101990002080300","15101990002080500","14509990002080100","14509990002080200","11306990005060100","11306990005060200","13416990005060100","13416990005060200","15101990005060100","15101990005060200","14509990005060100","14509990005060200","11306990005260100","13416990005260100","13416990005260200","15101990005260100","15101990005260200","14509990005260100","14509990005260200","14509990005260300","11306990005650400","11306990005650500","11306990005651500","13416990005650400","13416990005651500","15101990005650400","15101990005651500","14509990005650400","14509990005650500","14509990005651500","11306990006090700","11306990006090800","11306990006091000","11306990006091100","11306990006091200","11306990006091300","13416990006090800","13416990006091100","13416990006091200","15101990006090700","15101990006090800","15101990006091100","15101990006091200","15101990006091300","14509990006090700","14509990006090800","14509990006091100","14509990006091200","14509990006091300","11306990006810200","11306990006810300","11306990006810700","13416990006810200","13416990006810300","13416990006810700","15101990006810100","15101990006810200","15101990006810300","14509990006810200","14509990006810300","11306990006880100","11306990006880200","13416990006880100","13416990006880200","15101990006880100","15101990006880200","14509990006880300"]
A1=["安国药市","安国药市","安国药市","安国药市","安国药市","安国药市","亳州药市","亳州药市","亳州药市","亳州药市","亳州药市","亳州药市","亳州药市","荷花池药市","荷花池药市","荷花池药市","荷花池药市","荷花池药市","荷花池药市","玉林药市","玉林药市","玉林药市","玉林药市","玉林药市","玉林药市","安国药市","亳州药市","荷花池药市","荷花池药市","荷花池药市","玉林药市","安国药市","安国药市","亳州药市","亳州药市","荷花池药市","荷花池药市","荷花池药市","玉林药市","玉林药市","安国药市","安国药市","亳州药市","亳州药市","荷花池药市","荷花池药市","玉林药市","玉林药市","安国药市","安国药市","安国药市","亳州药市","亳州药市","亳州药市","亳州药市","荷花池药市","荷花池药市","玉林药市","玉林药市","安国药市","安国药市","亳州药市","亳州药市","荷花池药市","荷花池药市","玉林药市","玉林药市","安国药市","安国药市","亳州药市","亳州药市","荷花池药市","荷花池药市","玉林药市","玉林药市","安国药市","安国药市","亳州药市","亳州药市","荷花池药市","荷花池药市","荷花池药市","玉林药市","玉林药市","安国药市","安国药市","安国药市","安国药市","安国药市","安国药市","安国药市","亳州药市","亳州药市","亳州药市","亳州药市","亳州药市","亳州药市","亳州药市","亳州药市","亳州药市","亳州药市","亳州药市","荷花池药市","荷花池药市","荷花池药市","玉林药市","玉林药市","玉林药市","安国药市","安国药市","亳州药市","亳州药市","荷花池药市","荷花池药市","玉林药市","安国药市","安国药市","亳州药市","亳州药市","荷花池药市","荷花池药市","玉林药市","玉林药市","安国药市","安国药市","安国药市","亳州药市","亳州药市","亳州药市","荷花池药市","荷花池药市","荷花池药市","玉林药市","玉林药市","玉林药市","安国药市","亳州药市","荷花池药市","玉林药市","安国药市","安国药市","安国药市","亳州药市","亳州药市","荷花池药市","荷花池药市","荷花池药市","玉林药市","玉林药市","玉林药市","安国药市","安国药市","安国药市","亳州药市","亳州药市","亳州药市","亳州药市","荷花池药市","荷花池药市","荷花池药市","玉林药市","玉林药市","安国药市","安国药市","亳州药市","亳州药市","亳州药市","亳州药市","亳州药市","荷花池药市","荷花池药市","玉林药市","玉林药市","安国药市","安国药市","亳州药市","亳州药市","荷花池药市","荷花池药市","玉林药市","玉林药市","安国药市","亳州药市","亳州药市","荷花池药市","荷花池药市","玉林药市","玉林药市","玉林药市","安国药市","安国药市","安国药市","亳州药市","亳州药市","荷花池药市","荷花池药市","玉林药市","玉林药市","玉林药市","安国药市","安国药市","安国药市","安国药市","安国药市","安国药市","亳州药市","亳州药市","亳州药市","荷花池药市","荷花池药市","荷花池药市","荷花池药市","荷花池药市","玉林药市","玉林药市","玉林药市","玉林药市","玉林药市","安国药市","安国药市","安国药市","亳州药市","亳州药市","亳州药市","荷花池药市","荷花池药市","荷花池药市","玉林药市","玉林药市","安国药市","安国药市","亳州药市","亳州药市","荷花池药市","荷花池药市","玉林药市"]
A2=["三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","丹参","丹参","丹参","丹参","丹参","丹参","当归","当归","当归","当归","当归","当归","当归","当归","当归","党参","党参","党参","党参","党参","党参","党参","党参","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","红参","红参","红参","红参","红参","红参","红参","红参","红景天","红景天","红景天","红景天","红景天","红景天","红景天","红景天","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","决明子","决明子","决明子","决明子","决明子","决明子","决明子","罗布麻叶","罗布麻叶","罗布麻叶","罗布麻叶","罗布麻叶","罗布麻叶","罗布麻叶","罗布麻叶","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","玫瑰花","玫瑰花","玫瑰花","玫瑰花","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","山药","山药","山药","山药","山药","山药","山药","山药","山药","山药","山药","山楂","山楂","山楂","山楂","山楂","山楂","山楂","山楂","石斛","石斛","石斛","石斛","石斛","石斛","石斛","石斛","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","鱼腥草","鱼腥草","鱼腥草","鱼腥草","鱼腥草","鱼腥草","鱼腥草"]
A3=["20头春七 云南","40头春七 云南","60头春七 云南","80头春七 云南","120头春七 云南","剪口春七 云南","20头春七 云南","40头春七 云南","60头春七 云南","80头春七 云南","120头春七 云南","无数头春七 云南","剪口春七 云南","20头春七 云南","40头春七 云南","60头春七 云南","80头春七 云南","120头春七 云南","无数头春七 云南","40头春七 云南","60头春七 云南","80头春七 云南","120头春七 云南","无数头春七 云南","剪口春七 云南","统个 山东","统个 山东","统个 山东","节子 四川","二级 四川","统个 山东","散把 甘肃","箱装 甘肃","散把 甘肃","箱装 甘肃","箱装大条 甘肃","箱装中条 甘肃","箱装小条 甘肃","散把 甘肃","箱装 甘肃","中条 甘肃","小条 甘肃","中条 甘肃","小条 甘肃","中条 甘肃","小条 甘肃","中条 甘肃","小条 甘肃","大丁 安徽","中丁 安徽","小丁 安徽","大丁 安徽","中丁 安徽","小丁 安徽","统片 安徽","纯白中心丁 云南","统丁 云南","统块 云南","大丁 云南","小抄含糖 东北","无糖小抄 东北","小抄含糖 东北","无糖小抄 东北","小抄含糖 东北","无糖小抄 东北","小抄含糖 东北","无糖小抄 东北","大花统 西藏","小花统 西藏","大花统 西藏","小花统 西藏","大花统 西藏","小花统 西藏","大花统 西藏","小花统 西藏","统个 内蒙","家种统个 甘肃","统个 内蒙","家种统个 甘肃","家种统片 甘肃","统片 内蒙","绵芪统个 四川","统个 内蒙","家种统个 甘肃","杭菊胎 浙江","杭菊散统 浙江","杭菊杀青统 浙江","贡菊七月统 安徽","贡菊朵菊统 安徽","贡菊太阳统 安徽","祁菊花 河北","杭菊胎 浙江","杭菊散统 浙江","杭菊杀青统 浙江","贡菊七月统 安徽","贡菊朵菊统 安徽","贡菊太阳统 安徽","祁菊花 河北","杭菊胎 江苏","杭菊散统 江苏","杭菊杀青统 江苏","亳菊统 安徽","杭菊胎 浙江","杭菊散统 浙江","贡菊统 安徽","杭菊胎 浙江","贡菊朵菊统 安徽","杭菊胎 江苏","统 河南","统 进口","统 河南","统 进口","统 进口","统 四川","统 进口","统 河北","统 新疆","统 河北","统 新疆","统 河北","统 新疆","统 河北","统 新疆","大个 广西","中个 广西","小个 广西","大个 广西","中个 广西","小个 广西","大个 广西","中个 广西","小个 广西","大个 广西","中个 广西","小个 广西","无硫统 山东","无硫统 山东","无硫统 山东","无硫统 山东","软个 新疆","硬个 新疆","软个 内蒙","软个 新疆","硬个 新疆","软个 新疆","硬个 新疆","软个 内蒙","软个 新疆","硬个 新疆","软个 内蒙","一二级 安徽","三四级 安徽","混级 安徽","一二级 安徽","三四级 安徽","混级 安徽","尾芍 安徽","中片 安徽","小片 安徽","统个 四川","中片 安徽","小片 安徽","毛条 河北","统片 河北","统片 广西","毛条 河南","毛统片 河南","毛条 河北","毛统片 河北","光条 河南","统片 河南","统片 广西","毛条 广西","手工统片 山东","机切统片 山东","手工统片 山东","机切统片 山东","手工统片 山东","机切统片 山东","手工统片 山东","机切统片 山东","黄草统条 云南","黄草统条 云南","枫斗统 云南","黄草统条 云南","枫斗统 云南","黄草统条 云南","枫斗统 云南","大瓜统条 广西","家混等 较广","统片 较广","野统 较广","家混等 较广","野统 较广","家混等 较广","野统 较广","家混等 较广","统片 较广","野统 较广","长支 国产","短支 国产","特大片","大片","中片","小片","短支 国产","大片","中片","长支 国产","短支 国产","大片","中片","小片","长支 国产","短支 国产","大片","中片","小片","不带头统 川贵陕","全叶 甘肃","不带头统 东北","不带头统 川贵陕","全叶 甘肃","不带头统 东北","带头统 川贵陕","不带头统 川贵陕","全叶 甘肃","不带头统 川贵陕","全叶 甘肃","家统 四川","野统 四川","家统 四川","野统 四川","家统 四川","野统 四川","家统 广西"]

B1=["三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","三七","陈皮","陈皮","陈皮","陈皮","陈皮","陈皮","陈皮","陈皮","丹参","丹参","丹参","丹参","丹参","丹参","丹参","丹参","丹参","丹参","丹参","丹参","丹参","丹参","当归","当归","当归","当归","当归","当归","当归","当归","当归","当归","当归","当归","当归","党参","党参","党参","党参","党参","党参","党参","党参","党参","党参","党参","党参","党参","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","茯苓","红参","红参","红参","红参","红参","红参","红参","红参","红参","红参","红参","红参","红参","红参","红参","红参","红参","红参","红参","红参","红景天","红景天","红景天","红景天","红景天","红景天","红景天","红景天","红景天","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","黄芪","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","菊花","决明子","决明子","决明子","决明子","决明子","决明子","决明子","决明子","决明子","罗布麻叶","罗布麻叶","罗布麻叶","罗布麻叶","罗布麻叶","罗布麻叶","罗布麻叶","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","罗汉果","玫瑰花","玫瑰花","玫瑰花","玫瑰花","玫瑰花","玫瑰花","玫瑰花","玫瑰花","玫瑰花","玫瑰花","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","肉苁蓉","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","白芍","山药","山药","山药","山药","山药","山药","山药","山药","山药","山药","山药","山药","山药","山药","山药","山药","山药","山楂","山楂","山楂","山楂","山楂","山楂","山楂","山楂","山楂","石斛","石斛","石斛","石斛","石斛","石斛","石斛","石斛","石斛","石斛","石斛","石斛","石斛","石斛","石斛","石斛","石斛","石斛","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","天麻","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","西洋参","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","淫羊藿","鱼腥草","鱼腥草","鱼腥草","鱼腥草","鱼腥草","鱼腥草","鱼腥草","鱼腥草"]
B2=["120头","20头","40头","60头","80头","剪口","叶","无数头","筋条","须","120头","20头","40头","60头","80头","剪口","叶","无数头","筋条","须","120头","20头","40头","60头","80头","无数头","筋条","120头","20头","40头","60头","80头","剪口","无数头","须","丝","统","丝","统","统","丝","统","丝","统","选","精品","统","二条","大条","统","统","三级","统","精品","统","统","统","散把","片","箱归中条","草把","散把","片","箱归中条","草把","散把","片","箱归","散把","箱归","白条党中统","白条党大统","白条党小统","过0.3筛片","白条党中统","白条党大统","白条党小统","白条党小统","白条党中统","白条党大统","白条党中统","白条党大统","白条党小统","块","小杭丁","皮","精片","统丁","统片","块","小杭丁","皮","精片","统丁","统片","皮","块","小杭丁","统丁","统丁","块","小杭丁","30支","30支无糖","64支","64支无糖","小抄","小抄无糖","30支","48支","64支","小抄","30支","45支","64支","小抄","16头","30支","30支低糖","64支","小抄","小抄低糖","大花","小花","大花","小花","大花","小花","大花","大花","小花","统","中条","大条","小条","小条","大条","中条","绵芪","绵芪大斜片","绵芪小斜片","中条","大条","家种片","小条","小条","中条","大条","无硫","统","统","统","统","统","无硫","统","统","统","统","包含量","统","统","统","统","统","统","统","统","统","统","统","统","统","统","统","1000个/箱","1200个/箱","2000个/箱","700个/箱","960个/箱","1200个/箱","2000个/箱","700个/箱","1200个/箱","700个/箱","960个/箱","1000个/箱","1200个/箱","2000个/箱","700个/箱","二茬","头茬","炕货","二茬","头茬","炕货","二茬","头茬","晒货","炕货","淡优","淡统","硬","统","淡优","淡统","硬","淡统","硬","硬","淡统","一二级","三四级","二三级","尾芍","熟狗头片","生狗头片","统","黑","一二级","三四级","二三级","尾芍","熟狗头片","生狗头片","一二级","三四级","二三级","尾芍","熟狗头片","生狗头片","统","黑","统","光条","毛条","统","光条选","光统","毛条","毛条","毛条","光统","圆片","毛条","统","光统","毛条","毛条","毛条","光统","手工片","机器片","炕片","统","手工片","手工片","机器片","机器片","手工片","大","小","枫斗","紫皮","耳环","铁皮","枫斗","紫皮","耳环","铁皮","大","大","枫斗","铁皮","耳环","枫斗","铁皮","耳环","一二级","一级","小","无硫","混级","特级","一二级","无硫","统","一级","二级","无硫","混级","特级","一级","无硫统","特级","统","短支10克","短支5克","长支7克","短支5克","短支5克","长支","短支5克","长支7克","短支","统","短支","短支5克","长支","长支","短支","长支7克","短支5克","短支5克","短支5克","长支7克","统","统","优","统","统","统","统","统","优质","统","统","统","统","家种","野生","家种","野生","家种","野生","统","野生"]
B3=["云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","云南","浙江","浙江","浙江","浙江","浙江","浙江","浙江","浙江","安徽","安徽","山东","山东","江苏","江苏","山东","河南","四川","山东","山东","河南","山东","河南","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","东北","东北","东北","东北","东北","东北","东北","东北","东北","东北","东北","东北","东北","东北","东北","东北","东北","东北","东北","东北","西藏","西藏","西藏","西藏","西藏","西藏","·西藏","东北","西藏","内蒙","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","四川","四川","四川","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","甘肃","安徽","安徽","山西","河北","安徽","河北","河北","安徽","河北","安徽","河北","国产","国产","进口","国产","进口","国产","进口","国产","进口","天津","新疆","天津","新疆","新疆","天津","新疆","广西","广西","广西","广西","广西","广西","广西","广西","广西","广西","广西","广西","广西","广西","广西","山东","山东","甘肃","山东","山东","甘肃","山东","山东","山东","山东","新疆","新疆","新疆","青海","新疆","新疆","新疆","新疆","新疆","新疆","新疆","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","广西","广西","河北","河南","河南","河南","广西","河南","河南","广西","广西","河北","河南","河南","广西","河南","河南","山东","山东","山东","山东","山东","山东","山东","山东","山东","进口","进口","云南","较广","较广","较广","云南","较广","较广","较广","进口","进口","云南","云南","较广","云南","云南","浙江","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","安徽","进口","进口","进口","国产","国产","国产","进口","进口","加拿大","加拿大","国产","国产","国产","美国","美国","进口","进口","国产","进口","进口","东北","四川","甘肃","甘肃","陕西","东北","四川","甘肃","甘肃","东北","甘肃","东北","甘肃","四川","四川","四川","四川","四川","四川","四川","四川"]
B4=["亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","安国市场","安国市场","安国市场","安国市场","安国市场","安国市场","安国市场","成都市场","成都市场","成都市场","成都市场","成都市场","成都市场","成都市场","玉林市场","玉林市场","玉林市场","玉林市场","玉林市场","玉林市场","玉林市场","玉林市场","亳州市场","亳州市场","安国市场","安国市场","成都市场","成都市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","成都市场","成都市场","成都市场","成都市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","安国市场","成都市场","成都市场","成都市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","成都市场","成都市场","成都市场","玉林市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","安国市场","安国市场","安国市场","成都市场","成都市场","成都市场","成都市场","玉林市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","安国市场","成都市场","成都市场","成都市场","成都市场","玉林市场","玉林市场","玉林市场","玉林市场","玉林市场","玉林市场","亳州市场","亳州市场","安国市场","安国市场","成都市场","成都市场","玉林市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","成都市场","成都市场","成都市场","成都市场","成都市场","成都市场","成都市场","玉林市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","成都市场","成都市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","成都市场","成都市场","玉林市场","玉林市场","亳州市场","亳州市场","安国市场","安国市场","成都市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","成都市场","成都市场","成都市场","玉林市场","玉林市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","成都市场","成都市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","成都市场","成都市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","安国市场","安国市场","安国市场","成都市场","成都市场","成都市场","成都市场","成都市场","成都市场","成都市场","成都市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","成都市场","成都市场","成都市场","成都市场","成都市场","玉林市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","成都市场","成都市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","安国市场","安国市场","成都市场","成都市场","成都市场","成都市场","玉林市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","成都市场","成都市场","成都市场","成都市场","成都市场","玉林市场","玉林市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","安国市场","成都市场","成都市场","成都市场","成都市场","成都市场","成都市场","成都市场","成都市场","成都市场","玉林市场","玉林市场","玉林市场","亳州市场","亳州市场","亳州市场","亳州市场","亳州市场","安国市场","安国市场","安国市场","安国市场","成都市场","成都市场","玉林市场","玉林市场","亳州市场","亳州市场","安国市场","安国市场","成都市场","成都市场","玉林市场","玉林市场"]

url = 'https://www.zyctd.com/Breeds/GetPriceChart'
headers = {
    "Host": "www.zyctd.com",
    "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0",
    "Accept": "*/*",
    "Accept-Language": "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
    "Accept-Encoding": "gzip, deflate, br",
    "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    "X-Requested-With": "XMLHttpRequest",
    "Referer": "https://www.zyctd.com/jiage/xq70.html",
    "Content-Length": "35",
    "Cookie": "FromsAuthByDbCookie_zytd_Edwin.PrvGuest=1c1uuuuuuuuuuaIab597WcT17c4818Vbc1SaSc1U5acUWcbU4WS0o5qqnc78ca99o698qac9nadmoll5moad015; UM_distinctid=171722e10003d-0a2865dac79651-17397540-15f900-171722e1001341; CNZZDATA1261355531=1147626159-1586755002-%7C1586851405; Hm_lvt_ba57c22d7489f31017e84ef9304f89ec=1586758554,1586830545,1586852111; Hm_lpvt_ba57c22d7489f31017e84ef9304f89ec=1586852111",
    "Connection": "keep-alive"
}
for j in range(len(A)):
    try:
        #print("获取页数:",j)
        stop = random.uniform(1, 3)
        data = {"PriceType":"day","mid":A[j]} 
        response = requests.post(url=url, data=data, headers=headers, timeout=10)
        content0 = json.loads(response.text)
        content = content0['Data']['PriceChartData']
        it = re.findall('\\[(.*?),(.*?)\\]',content)
        for i in range(len(it)):
            #list2 = []
            name.append(A2[j])
            specs.append(A3[j])
            market.append(re.sub('药市','',A1[j]))
            if i == 0:
                a1 = it[i][0].replace(it[0][0][0],'')
            else:
                a1 = it[i][0]
            timeStamp = int(a1)/1000
            timeArray = time.localtime(timeStamp)
            otherStyleTime = time.strftime("%Y-%m-%d", timeArray)
            date.append(otherStyleTime)
            price.append(it[i][1])
            website.append("天")
            #list1.append(list2)
    
    except:
        print("出错",j)
url = 'https://www.yt1998.com/price/historyPriceQ!getHistoryPrice.do'

headers = {
    "Host": "www.yt1998.com",
    "Connection": "keep-alive",
    "Content-Length": "42",
    "Accept": "application/json, text/javascript, */*; q=0.01",
    "Origin": "https://www.yt1998.com",
    "X-Requested-With": "XMLHttpRequest",
    "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
    "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
    "Referer": "https://www.yt1998.com/priceHistory.html?keywords=%E7%9F%B3%E5%88%81%E6%9F%8F&guige=%E7%BB%9F&chandi=%E6%96%B0%E7%96%86&market=1",
    "Accept-Encoding": "gzip, deflate, br",
    "Accept-Language": "zh-CN,zh;q=0.9",
    "Cookie": "JSESSIONID=ADC6AAA4C1429B382CCA1BAABB8E688D; Hm_lvt_21f2fde8228a3428719fdc5669ab5410=1586739170,1586831855,1587015027,1588055351; Hm_lpvt_21f2fde8228a3428719fdc5669ab5410=1588055496"

}
for j in range(len(B1)):
    try:
        #print("获取页数:",j)
        stop = random.uniform(1, 3)
        data = {"ycnam": B1[j],"guige": B2[j],"chandi": B3[j],"market": B4[j]}
        response = requests.post(url=url, data=data, headers=headers, timeout=10)
        content0 = json.loads(response.text)
        content = content0['data']
        
        for i in range(len(content)):
            list2 = []
            name.append(B1[j])
            specs.append(B2[j]+' '+B3[j])
            market.append(re.sub('市场','',B4[j]))
            date.append(content[i]['Date_time'])
            price.append(content[i]['DayCapilization'])
            website.append("通")
    except:
        print("出错",j)
Attractions=pd.DataFrame({'品名':name,'规格':specs,'市场':market,'日期':date,'价格':price,'网站':website})
#print(Attractions)        

            
     